package com.cindata

class RiskWarningConfigure
{
    BigDecimal valueRiseWeight
    // 价值上升波动范围
    BigDecimal valueDeclineWeight
    // 价值下降波动范围

    BigDecimal contactOverdueWeight
    // 个人逾期次数
    BigDecimal contactBreachWeight
    // 个人违约次数
    BigDecimal accountOverdueWeight
    // 企业逾期次数
    BigDecimal accountBreachWeight
    // 企业违约次数

    BigDecimal concentrationRiskWeight
    // 集中度风险综合评分

    BigDecimal coverRateOfCityWeight
    // 城市占比覆盖度
    BigDecimal coverRateOfCommunityWeight
    // 小区占比覆盖度

    String publicOpinionsWeight
    // 舆情预警配置

    BigDecimal effectiveDaysWeight
    // 到期距离天数

    BigDecimal buildingRatedWeight
    // 楼盘评分

    String contactCreditWeight
    // 借款人预警配置

    static constraints =
        {
            valueRiseWeight precision: 8, scale: 4, nullable: true, blank: true, comment: '价值上升波动范围'
            valueDeclineWeight precision: 8, scale: 4, nullable: true, blank: true, comment: '价值下降波动范围'

            contactOverdueWeight precision: 8, scale: 4, nullable: true, blank: true, comment: '个人逾期次数'
            contactBreachWeight precision: 8, scale: 4, nullable: true, blank: true, comment: '个人违约次数'
            accountOverdueWeight precision: 8, scale: 4, nullable: true, blank: true, comment: '企业逾期次数'
            accountBreachWeight precision: 8, scale: 4, nullable: true, blank: true, comment: '企业违约次数'

            concentrationRiskWeight precision: 8, scale: 4, nullable: true, blank: true, comment: '集中度风险综合评分'

            coverRateOfCityWeight precision: 8, scale: 4, nullable: true, blank: true, comment: '城市占比覆盖度'
            coverRateOfCommunityWeight precision: 8, scale: 4, nullable: true, blank: true, comment: '小区占比覆盖度'

            publicOpinionsWeight precision: 8, scale: 4, nullable: true, blank: true, comment: '舆情预警配置'

            effectiveDaysWeight precision: 8, scale: 4, nullable: true, blank: true, comment: '到期距离天数'

            buildingRatedWeight precision: 8, scale: 4, nullable: true, blank: true, comment: '楼盘评分'

            contactCreditWeight precision: 8, scale: 4, nullable: true, blank: true, comment: '借款人预警配置'
        }

    static initData()
    {
        if (RiskWarningConfigure.count() < 1)
        {
            def rsc = new RiskWarningConfigure()
            rsc.valueRiseWeight = 0.1
            rsc.valueDeclineWeight = 0.1

            rsc.contactOverdueWeight = 6
            rsc.contactBreachWeight = 2
            rsc.accountOverdueWeight = 6
            rsc.accountBreachWeight = 2

            rsc.concentrationRiskWeight = 3.0

            rsc.coverRateOfCityWeight = 0.1
            rsc.coverRateOfCommunityWeight = 0.1

            rsc.publicOpinionsWeight = "洪水,火灾,欠税,股权转让,"

            rsc.effectiveDaysWeight = 30

            rsc.buildingRatedWeight = 3.0

            rsc.contactCreditWeight = "多平台借贷,家庭住址,物流地址,司法信息,运营商信息,纳税信息,征信信息,出行信息,"

            rsc.save()
        }
    }
}
